﻿define(function (require) {
    var ProjectView = require('view/ProjectView');
    
    return Backbone.View.extend({
        el: $(".ui-listview"),
        events: {
            
        },

        initialize: function () {
            _.bindAll(this, 'addOne', 'addAll', 'render');
            this.model.bind('reset', this.render);
        },
        date: null,
        render: function () {
            $(".ui-listview").empty();
            this.addAll();    
        },
        addOne: function (e) {
            var view = new ProjectView({ model: e });
            var element = view.render().el;
            this.el.append(element);
        },

        addAll: function () {
            this.model.each(this.addOne);
        },
        clear: function (e) {
        
        }

    });

});